<template>
  <div class="fns-imgDialog-component">
  <div v-if="imgDialogData.dialogVisible">
    <el-dialog
      title=""
      :visible.sync="imgDialogData.dialogVisible"
      custom-class="fns-imgDialog-item"
      :close-on-click-modal="false"
      append-to-body>
      <div class="imgbox" v-if="imgDialogData.imgSrc.length === 1">
        <img :src="imgDialogData.imgSrc[0].imageUrl" alt="图片" width="100%" height="100%">
      </div>
      <div class="block" style="margin-top: 0;height: 100%;text-align: center;" v-else>
        <el-carousel :autoplay="false" :interval="2000" :initial-index="imgDialogData.index" >
          <el-carousel-item v-for="(item, index) in imgDialogData.imgSrc" :key="index"class="el-carousel-item">
            <img :src="item.imageUrl" alt="图片" width="100%" height="100%">
          </el-carousel-item>
        </el-carousel>
      </div>
    </el-dialog>
    </div>
  </div>
</template>

<script>
  export default {
    props: {
      imgDialogData: {
        dialogVisible: {
          default: false
        }
      }
    },
    computed: {
    },
    watch: {
    },
    components: {
    },
    data() {
      return {
      }
    },
    methods: {
    }
  }
</script>

<style lang="scss">
  /*放大图片弹窗组件imgDialog*/
.fns-imgDialog-item {
  background: #000;
  .el-dialog__body {
     padding: 0 !important;
     .el-carousel__container {
      height: 550px !important;
     }
  }
}
  .fns-imgDialog-item {
    width: 600px;
     height: 100% !important;
    .imgbox {
      width: 100%;
      // max-height: 500px;
      // overflow-y: auto;
      img {
        width: 100%;
      }
    }
    .el-carousel__container {
     /*  height: auto;
     min-height: 500px; */
     height: auto;
      .el-carousel-item {
        width: 100%;
         height: 100%;
        //overflow-y: auto;
        img {
          width: 100%;
          // height: 100%;
        }
      }
    }
  }

</style>

